package com.buobao.oa.service;

import com.buobao.oa.dao.DepartmentDao;
import com.buobao.oa.entity.Department;
import com.buobao.oa.utils.MybatisUtils;

public class DepartmentService {
    public Department getDepartmentById(Long departmentId) {
        return (Department) MybatisUtils.executeQuery(sqlSession -> {
            DepartmentDao departmentDao = sqlSession.getMapper(DepartmentDao.class);
            return departmentDao.selectByDepartmentId(departmentId);
        });

    }
}
